package Reflection;

/**
 * @author fangkun
 * @create 2022-04-24-13:41
 */
public class Student {

    public String name;
    private int age;

    public Student() {
        System.out.println("无参构造执行了。。。");
    }

    public Student(String name) {
        this.name = name;
        System.out.println("有参构造执行了。。。" + "参数：" + name);

    }

    private Student(int age) {
        this.age = age;
        System.out.println("私有有参构造执行了。。。" + "参数：" + age);
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("有参构造执行了。。。" + "参数：" + name + "," +age);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    
    public void sayName(String name){
        System.out.println("Public: My name is "+ name + "!!!");
    }
    
    private void sayAge(int age){
        System.out.println("Private: I am "+ age + "year's old!!!");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public static void main(String[] args) {
        System.out.println("main 方法执行了。。。。");
    }

}
